<?php
/*
  Document   : Student verwijderen
  Created on : 31-mei-2011, 14:22:08
  Author     : Shahram abdi
 */
// Make sure the user is logged in before going any further.

if (!isset($_SESSION['username'])) {
    echo '<p>Please <a href="login.php">log in</a> to access this page.</p>';
    exit();
}
require_once("nieuwsDB.class.php");

if (isset($_POST['submit'])) {
    if (isset($_POST['student']))
        $students = $_POST['student'];
    if (empty($students)) {
        echo("You didn't select any contract.");
    } else {
        $beheer = new Beheer();
        $N = count($students);
        for ($i = 0; $i < $N; $i++) {
            $beheer->deleteStudents($students[$i]);
        }
    }
} else {
?>
    <div id="content">
        <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
            <div id="deletestudent">
            </div>
            <input type="submit" name="submit" value="Delete">
        </form>
    </div>
<?php
}
?>